<?php

namespace App\Exports\Stats\Platform;

use App\Exports\Export;

class SettlementUsdExport extends Export
{

    /**
     * 映射标题行
     *
     * @return array
     */
    protected function headings(): array
    {
        return trans('view.stats.platform.settlement-usd.headings');
    }

    /**
     * 映射数据行
     *
     * @param \Illuminate\Database\Eloquent\Model $item
     * @return array
     */
    protected function map($item): array
    {
        return [
            $item->org->name ?? $item->plat_code,
            $item->bet_base,
            $item->bet_num,
            $item->gain_player,
            $item->doc_count,
            $item->player_count,
        ];
    }

    /**
     * 初始化操作
     */
    protected function init()
    {
        // 文件名称
        $this->filename = trans('view.stats.platform.settlement-usd.filename');
    }
}
